package com.saunter.utils.response;

import com.github.pagehelper.Page;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CustomPage<T> {
    private List<T> data;
    private int page_no;
    private int page_size;
    private int page_count;
    private long total;

    public CustomPage(List<T> data) {
        this.data = data;
        Page<T> page = (Page) data;
        this.page_no = page.getPageNum();
        this.page_size = page.getPageSize();
        this.page_count = page.getPages();
        this.total = page.getTotal();
    }

    public void setData(List<T> data) {
        this.data = data;
    }
    public List<T> getList() {
        return this.data;
    }
    public int getPage_no() {
        return this.page_no;
    }
    public int getPage_size() {
        return this.page_size;
    }
    public int getPage_count() {
        return this.page_count;
    }
    public long getTotal() {
        return this.total;
    }
}
